#coding=utf8
import sys, os
import requests, json
import re

import sys, os
import requests, json
import uuid
import base64 
from Crypto.Cipher import AES
import logging
import datetime

import re

import os
import logging.config
from logging.handlers import TimedRotatingFileHandler

__strCurrentDir__ = os.path.abspath(os.path.dirname(__file__))
__strModuleDir__ = os.path.dirname(__strCurrentDir__)

def InitLogger(logFile, logLevel):
    logger = logging.getLogger()
    fileHandler = TimedRotatingFileHandler(logFile, when='D', interval=1, backupCount=20)
    formatter = logging.Formatter("%(asctime)s %(filename)s %(funcName)s %(lineno)s \
     %(threadName)s - %(levelname)s - %(message)s")

    fileHandler.setFormatter(formatter)
    logger.addHandler(fileHandler)
    logger.setLevel(logLevel)
    return logger

logger = InitLogger(
    f"wechatauto.log",
    logging.INFO,
)